package com.qy.entity;

public class AccessToken {
	private String token;
	private long expiresTime;//过期时间
	
	

	public AccessToken(String token, String expiresIn) {
		super();
		this.token = token;
		//当前时间+有效期 = 过期时间
		this.expiresTime = System.currentTimeMillis()+Integer.parseInt(expiresIn);
	}
	
	/**
	 * 判断token是否过期
	 * @return
	 */
	public boolean isExpire() {
		return System.currentTimeMillis() > expiresTime;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public long getExpiresTime() {
		return expiresTime;
	}

	public void setExpiresTime(long expiresTime) {
		this.expiresTime = expiresTime;
	}

}

